<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" 
src="js/prototype-1.6.0.3.js">
</script>
<script type="text/javascript">
	function f1(){
		var obj = new Object();
		obj.name = 'Sally';
		obj.age = 22;
		showObject(obj);
	}
	
	function f2(){
		var obj = {"name":"Eric","age":22};
		showObject(obj);
	}
	
	function showObject(o){
		alert(o.name)
	}
	
	function f3(){
		var obj = {"company":"达内",
		"address":{
				"city":"北京",
				"street":"北三环大钟寺",
				"room":709
			}
		};
		alert(obj.company + " " + obj.address.street);
	}
	
	function f4(){
		var arr = [{"name":"Eric","age":22},
		{"name":"Tom","age":32}];
		alert(arr[1].name);
	}
	
	function f5(){
		var  str = '{"name":"Eric","age":22}';
		var obj = str.evalJSON();
		alert(obj.name);
	}
	
	function f6(){
		var str = '[{"name":"Eric","age":22},' 
		+ '	{"name":"Tom","age":32}]';
		var arr = str.evalJSON();
		alert(arr[1].name);
	}
</script>
</head>
<body style="font-size:30px;">
	<a href="javascript:;" onclick="f2();">ClickMe</a>
</body>
</html>